
let forgeLevels = [
    { level: 1, weight: 6900 },
    { level: 1, weight: 6500 },
    { level: 1, weight: 6200 },
    { level: 2, weight: 2500 },
    { level: 3, weight: 500 },
    { level: 4, weight: 100 },
    { level: 5, weight: 0 },
    { level: 6, weight: 0 },
    { level: 7, weight: 0 },
    { level: 8, weight: 0 },
    { level: 9, weight: 0 },
];
let foMap:Map<number, {level:number,weight:number}[]>  = new Map();
// const weights:number[] = [];
for (let quality of forgeLevels) {
    let itm = foMap.get(quality.level);
    if (itm) {
        itm.push(quality);
    } else {
        foMap.set(quality.level,[quality]);
    }
    // weights.push(quality.weight);
}
// let data =math.pickRandom(forgeLevels,1, weights);

// let equip = chance.pickone(forgeLevels);
// equip.weight = equip.weight - 1;
// console.log(equip, forgeLevels);
let forge = forgeLevels.find(v=>v.level ==1);
forge.weight += 100;
console.log(forge,forgeLevels,foMap);